/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package teste;

import ifpb.pp.rh.constant.Importancia;
import ifpb.pp.rh.constant.Status;
import ifpb.pp.rh.dao.DAO;
import ifpb.pp.rh.entity.Lembrete;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;

/**
 *
 * @author Gabriella
 */
//@Component
public class AAA {

//    @Autowired
//    private static DAO dao;

    public static void main(String[] args) {
        Lembrete l = new Lembrete("Vamo ver se *", Importancia.Alta, Status.Adamento, new Date());
        System.out.println("inicializandooooo..");
        AbstractApplicationContext ctx = new  ClassPathXmlApplicationContext("classpath:ifpb/pp/rh/resource/spring-annotation*.xml");


        //        AbstractApplicationContext ctx = new  ClassPathXmlApplicationContext("classpath:../web/WEB-INF/spring-annotation*.xml");
//          String path = "oi/spring-annotation-beans.xml";
//        ApplicationContext ctx =
//                new ClassPathXmlApplicationContext(path);       

        DAO dao =  (DAO) ctx.getBean("dao");


//        AbstractApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:ifpb/pp/rh/resource/spring-annotation*.xml");
//        ctx.getAutowireCapableBeanFactory().autowireBean(dao);
        try {
            dao.salvar(l);
            System.out.println("kkkkkkkkkkkkkkk");
        } catch (Exception ex) {
            ex.printStackTrace();
        }

    }
}
